package client

import (
	"fmt"
	"gitee.com/kaylee595/gkaylee/kerr"
	"github.com/imroc/req/v3"
)

func unmarshalJson(resp *req.Response, v any) error {
	err := resp.UnmarshalJson(v)
	if err != nil {
		return kerr.WrapTraceStack(fmt.Errorf("%w: resp body: %s", err, resp.String()))
	}
	return nil
}
